/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.deib.se2.meteocal.business.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;

@Entity(name = "LOCATIONS")
public class Location implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @NotNull
    private long id;
    
    @NotNull
    private String loc_name;
    
    private String Weather;
    
    //location has many events
    @OneToMany(mappedBy="idLocation")
    private List<Event> event;
    
    public Location() {
        event = new ArrayList<Event>();
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
    /**
     * @return the loc_name
     */
    public String getLocName() {
        return loc_name;
    }

    /**
     * @param loc_name the loc_name to set
     */
    public void setLocName(String loc_name) {
        this.loc_name = loc_name;
    }

    /**
     * @return the Weather
     */
    public String getWeather() {
        return Weather;
    }

    /**
     * @param Weather the Weather to set
     */
    public void setWeather(String Weather) {
        this.Weather = Weather;
    }

    /**
     * @return the event
     */
    public List<Event> getEvent() {
        return event;
    }

    /**
     * @param event the event to set
     */
    public void setEvent(List<Event> event) {
        this.event = event;
    }
    
}
